﻿USE [HR_DB]
GO
if exists(select * from dbo.sysobjects where id = object_id(N'users')   and   OBJECTPROPERTY(id,   N'IsUserTable')   =   1)   
  drop table users   
-- =============================================
-- Author:杨洁(kaixuanpisces)
-- Create date: 20090728
-- Description:	用户表
-- =============================================
CREATE TABLE [dbo].[users](
	[u_id] [smallint] IDENTITY(1,1) NOT NULL,
	[u_name] [varchar](60) NOT NULL,
	[u_true_name] [varchar](60) NOT NULL,
	[u_password] [char](32) NOT NULL,
	[u_start_time] [smalldatetime] NOT NULL,
 CONSTRAINT [users_PK] PRIMARY KEY CLUSTERED 
(
	[u_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO

-- ==============================================
-- 列名说明
-- ==============================================

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户编号,自动增长列' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'users', @level2type=N'COLUMN',@level2name=N'u_id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'users', @level2type=N'COLUMN',@level2name=N'u_name'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'真实姓名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'users', @level2type=N'COLUMN',@level2name=N'u_true_name'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'密码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'users', @level2type=N'COLUMN',@level2name=N'u_password'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开始时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'users', @level2type=N'COLUMN',@level2name=N'u_start_time'


-- ===============================================
-- 测试数据
-- ===============================================
insert into users(u_name,u_true_name,u_password,u_start_time) values('admin','系统管理员','e10adc3949ba59abbe56e057f20f883e',getdate())
insert into users(u_name,u_true_name,u_password,u_start_time) values('kaixuanpisces','杨洁','e10adc3949ba59abbe56e057f20f883e',getdate())
insert into users(u_name,u_true_name,u_password,u_start_time) values('AntonioJoJo1113','焦世伟','e10adc3949ba59abbe56e057f20f883e',getdate())
insert into users(u_name,u_true_name,u_password,u_start_time) values('lunizhang','张顺琦','e10adc3949ba59abbe56e057f20f883e',getdate())
insert into users(u_name,u_true_name,u_password,u_start_time) values('zxz190','张晓战','e10adc3949ba59abbe56e057f20f883e',getdate())
